package db

import (
// "time"
)

type Customer struct {
	Id int64 `gorm:"column:id"`
	//	Phone		string		`gorm:"column:phone"`
	//	Name		string		`gorm:"column:name"`
	//	Passwd		string		`gorm:"column:passwd"`
	//	Passwd_hash	string		`gorm:"column:passwd_hash"`
	Token string `gorm:"column:token"`
	// Created_ip	string		`gorm:"column:Created_ip"`
	// Created		time.Time	`gorm:"column:created"`
	// Updated		time.Time	`gorm:"column:updated"`
}

func (customer *Customer) TableName() string {
	return "customer"
}

/*
func (customer *Customer)Updates(mmap map[string]interface{}) error{
	result := conn.Model(customer).Updates(mmap)
	return result.Error
}*/

func (customer *Customer) GetTokenById() error {
	result := Conn.Where("Id = ?", customer.Id).Find(&customer)
	if result.Error != nil {
		return result.Error
	}
	return nil
}
